// MyGame.h: interface for the CMyGame class.
//
//////////////////////////////////////////////////////////////////////

#ifndef __DEVICE_H__
#define __DEVICE_H__

#include "../Predefine.h"
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;


class CDevice
{
CDevice();
	virtual ~CDevice();
public:
	IFileSystem *				m_irrFileSystem;
	IVideoDriver *				m_irrDriver;
	ISceneManager *				m_irrSceneManager;	
	IrrlichtDevice *			m_irrDevice;


public:
	IFileSystem * GetFileSystem();
	IVideoDriver * GetVideoDriver();
	ISceneManager * GetSceneManager();
	ISceneManager * GetSceneManagerBackup();
	IrrlichtDevice * GetIrrlichtDevice();


public:
	void BeginScene();
	void EndScene();

	void InitializeFileSystem();
	void Initialize();

public:
	
	static CDevice*			m_pInstance;
	static CDevice*			Instance()
	{
		if(!m_pInstance)
		{
			m_pInstance =  NEW CDevice();
		}
		return m_pInstance;
	}

	static void							Destroy()
	{
		SAFE_DELETE(m_pInstance);
	}


};

#endif //__DEVICE_H__
